<%@ Page Language="C#" MasterPageFile="~/Administration/main.master" AutoEventWireup="true"
    CodeFile="AffiliateDetails.aspx.cs" Inherits="Tathata.Web.Administration.Administration_AffiliateDetails" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<%@ Register TagPrefix="nopCommerce" TagName="SimpleTextBox" Src="Modules/SimpleTextBox.ascx" %>
<%@ Register TagPrefix="nopCommerce" TagName="EmailTextBox" Src="Modules/EmailTextBox.ascx" %>
<asp:Content ID="c1" ContentPlaceHolderID="cph1" runat="Server">
    <div>
        <ajaxToolkit:TabContainer runat="server" ID="AffiliateTabs" ActiveTabIndex="0">
            <ajaxToolkit:TabPanel runat="server" ID="pnlAffiliateInfo" HeaderText="Affiliate Info">
                <ContentTemplate>
                    <table class="adminContent">
                        <tr>
                            <td class="adminTitle">
                                First name:
                            </td>
                            <td class="adminData">
                                <asp:TextBox ID="txtFirstName" runat="server" CssClass="adminInput"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="adminTitle">
                                Last name:
                            </td>
                            <td class="adminData">
                                <nopCommerce:SimpleTextBox runat="server" ID="txtLastName" CssClass="adminInput"
                                    ErrorMessage="Last name is required"></nopCommerce:SimpleTextBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="adminTitle">
                                Middle name:
                            </td>
                            <td class="adminData">
                                <asp:TextBox ID="txtMiddleName" runat="server" CssClass="adminInput"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="adminTitle">
                                Phone number:
                            </td>
                            <td class="adminData">
                                <asp:TextBox ID="txtPhoneNumber" runat="server" CssClass="adminInput"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="adminTitle">
                                Email:
                            </td>
                            <td class="adminData">
                                <nopCommerce:EmailTextBox runat="server" ID="txtEmail" CssClass="adminInput"></nopCommerce:EmailTextBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="adminTitle">
                                FaxNumber:
                            </td>
                            <td class="adminData">
                                <asp:TextBox ID="txtFaxNumber" runat="server" CssClass="adminInput"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="adminTitle">
                                Company:
                            </td>
                            <td class="adminData">
                                <asp:TextBox ID="txtCompany" runat="server" CssClass="adminInput"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="adminTitle">
                                Address 1:
                            </td>
                            <td class="adminData">
                                <nopCommerce:SimpleTextBox runat="server" ID="txtAddress1" CssClass="adminInput"
                                    ErrorMessage="Address is required"></nopCommerce:SimpleTextBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="adminTitle">
                                Address 2:
                            </td>
                            <td class="adminData">
                                <asp:TextBox ID="txtAddress2" runat="server" CssClass="adminInput"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="adminTitle">
                                City:
                            </td>
                            <td class="adminData">
                                <nopCommerce:SimpleTextBox runat="server" ID="txtCity" CssClass="adminInput" ErrorMessage="City is required">
                                </nopCommerce:SimpleTextBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="adminTitle">
                                State / Province:
                            </td>
                            <td class="adminData">
                                <asp:TextBox ID="txtStateProvince" runat="server" CssClass="adminInput"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="adminTitle">
                                Zip / Postal code:
                            </td>
                            <td class="adminData">
                                <nopCommerce:SimpleTextBox runat="server" ID="txtZipPostalCode" CssClass="adminInput"
                                    ErrorMessage="Zip / Postal code is required"></nopCommerce:SimpleTextBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="adminTitle">
                                Country:
                            </td>
                            <td class="adminData">
                                <asp:DropDownList ID="ddlCountry" AutoPostBack="False" CssClass="adminInput" runat="server">
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td class="adminTitle">
                                Active:
                            </td>
                            <td class="adminData">
                                <asp:CheckBox ID="cbActive" runat="server"></asp:CheckBox>
                            </td>
                        </tr>
                    </table>
                </ContentTemplate>
            </ajaxToolkit:TabPanel>
            <ajaxToolkit:TabPanel runat="server" ID="pnlAffiliatedCustomers" HeaderText="Affiliated customers">
                <ContentTemplate>
                    <table class="adminContent">
                        <tr>
                            <td colspan="2" width="100%">
                                <asp:GridView ID="gvAffiliateCustomers" runat="server" AutoGenerateColumns="False"
                                    Width="100%">
                                    <Columns>
                                        <asp:BoundField DataField="CustomerID" HeaderText="CustomerID" Visible="False"></asp:BoundField>
                                        <asp:TemplateField HeaderText="Email" ItemStyle-Width="45%">
                                            <ItemTemplate>
                                                <a href="CustomerDetails.aspx?CustomerID=<%#Eval("CustomerID")%>">
                                                    <%#Server.HtmlEncode(Eval("Email").ToString())%>
                                                </a>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Name" ItemStyle-Width="45%">
                                            <ItemTemplate>
                                                <a href="CustomerDetails.aspx?CustomerID=<%#Eval("CustomerID")%>">
                                                    <%#Server.HtmlEncode(Eval("FullName").ToString())%>
                                                </a>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="View" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="10%"
                                            ItemStyle-HorizontalAlign="Center">
                                            <ItemTemplate>
                                                <a href="CustomerDetails.aspx?CustomerID=<%#Eval("CustomerID")%>">View</a>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                    </Columns>
                                </asp:GridView>
                            </td>
                        </tr>
                    </table>
                </ContentTemplate>
            </ajaxToolkit:TabPanel>
           
        </ajaxToolkit:TabContainer>
    </div>
    <table class="adminContent">
        <tr>
            <td class="adminTitle" align="left">
                <asp:Button ID="SaveButton" runat="server" CssClass="adminButton" Text="Save" OnClick="SaveButton_Click">
                </asp:Button>
            </td>
            <td class="adminData" align="left">
                <asp:Button ID="DeleteButton" runat="server" CssClass="adminButton" Text="Delete"
                    OnClick="DeleteButton_Click" CausesValidation="false"></asp:Button>
                <ajaxToolkit:ConfirmButtonExtender ID="ConfirmDeleteButtonExtender" runat="server"
                    TargetControlID="DeleteButton" DisplayModalPopupID="ModalPopupExtenderDelete" />
                <br />
                <ajaxToolkit:ModalPopupExtender ID="ModalPopupExtenderDelete" runat="server" TargetControlID="DeleteButton"
                    PopupControlID="pnlDeletePopup" OkControlID="deleteButtonOk" CancelControlID="deleteButtonCancel"
                    BackgroundCssClass="modalBackground" />
                <asp:Panel ID="pnlDeletePopup" runat="server" Style="display: none; width: 250px;
                    background-color: White; border-width: 2px; border-color: Black; border-style: solid;
                    padding: 20px;">
                    <div style="text-align: center;">
                        Are you sure?
                        <br />
                        <br />
                        <asp:Button ID="deleteButtonOk" runat="server" Text="OK" CssClass="adminButton" CausesValidation="false" />
                        <asp:Button ID="deleteButtonCancel" runat="server" Text="Cancel" CssClass="adminButton"
                            CausesValidation="false" />
                    </div>
                </asp:Panel>
            </td>
        </tr>
    </table>
</asp:Content>
